package cn.Controller;

import cn.Service.DialogueService;
import cn.entity.Dialogue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class DialogueController {
    @Autowired
    private DialogueService service;
    @GetMapping("/FindAllDialogue")
    public String FindAllDialogue(Model model){
        List<Dialogue> dialogues = service.FindAllDialogue();
        System.out.println(dialogues.toString());
        model.addAttribute("Dialogues",dialogues);
        return "adminreply";
    }
}
